# Maintainer: Wu, Zhenyu <wuzhenyu@ustc.edu>

_realname=ansifilter
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=2.21
pkgrel=1
pkgdesc="remove or convert ANSI codes to another format (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://gitlab.com/saalen/ansifilter"
license=('spdx:GPL-3.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
source=("https://gitlab.com/saalen/ansifilter/-/archive/${pkgver}/${_realname}-${pkgver}.tar.bz2")
sha256sums=('5ea7cfdfd0752d5a169259da005c18b9037628036fd89d8b82624bacec9c1390')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make all
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make DESTDIR="${pkgdir}" PREFIX="/$MINGW_PREFIX" install
  rm "${pkgdir}/$MINGW_PREFIX/share/doc/ansifilter/COPYING" \
     "${pkgdir}/$MINGW_PREFIX/share/doc/ansifilter/INSTALL"
}
